<!-- START:snip0 -->
<body><div><form>
  <p>Programmer Interview Questions</p>
  <div class="questions">
    <p>
      <span><input type="radio" name="q1" value="yes">Yes</span>
      <span><input type="radio" name="q1" value="no">No</span>
      Are you a C programmer?
    </p><p>
      <span><input type="radio" name="q1-yes" value="yes">Yes</span>
      <span><input type="radio" name="q1-yes" value="no">No</span>
      <span><input type="radio" name="q1-yes" value="maybe">Don't know</span>
      Have you read Kernighan and Ritchie?
    </p><p>
    
    <!-- etc. -->
  
  </div>
</form></div></body>
<!-- END:snip0 -->

<!-- START:snip1 -->
dojo.query("div.questions p");
<!-- END:snip1 -->

<script type="text/javascript">
<!-- START:snip7 -->
result= myNodeList.coords();
//is equivalent to...
result= myNodeList.map(dojo.coords);
<!-- END:snip7 -->

<!-- START:snip8 -->
//getter...
result= myNodeList.attr(property);
//is equivalent to...
result= myNodeList.map(
  function(node){return dojo.attr(node, property);}
);
//result is an array of strings

//setter...
result= myNodeList.attr(property, value);
//is equivalent to...
myNodeList.forEach(
  function(node){dojo.attr(node, property, value);}
);
result= myNodeList;
//result is the original MyNodeList
<!-- END:snip8 -->

<!-- START:snip9 -->
result= myNodeList.addClass(className);
//is equivalent to...
myNodeList.forEach(
  function(node){dojo.addClass(node, className);}
);
result= myNodeList;
//result is the original MyNodeList
<!-- END:snip9 -->


<!-- START:snip10 -->
//referenceNode is a DOM node...
result= myNodeList.place(referenceNode, position);
//is equivalent to...
myNodeList.forEach( 
  function(node){dojo.place(node, referenceNode, position);}
);
result= myNodeList;
//result is the original MyNodeList

//referenceNode is a selector...
result= myNodeList.place(selector, position);
//is equivalent to...
myNodeList.forEach( 
  function(node){dojo.place(node, dojo.query(selector)[0], position);}
);
result= myNodeList;
//result is the original MyNodeList
<!-- END:snip10 -->


<!-- START:snip11 -->
//no handler context provided
result= myNodeList.connect(event, handler);
//is equivalent to...
myNodeList.forEach( 
  function(node){dojo.connect(node, event, handler);}
);
result= myNodeList;
//result is the original MyNodeList

//with handler context
result= myNodeList.connect(event, context, handler);
//is equivalent to...
myNodeList.forEach( 
  function(node){dojo.connect(node, event, context, handler);}
);
result= myNodeList;
//result is the original MyNodeList
<!-- END:snip11 -->
</script>

